<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-form ref="form" :model="product_process" :rules="rules" label-width="100px" id="mvcfm">
      <div class="form-unit">
        <span class="mvc-title-left"> 工序明细 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="12">
            <el-form-item label="工序名称" prop="process_name">
              <el-input v-model="product_process.process_name" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="工序号" prop="process_no">
              <el-input v-model="product_process.process_no" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="变更状态" prop="process_alter">
              <el-radio-group v-model="product_process.process_alter">
                <el-radio-button label="0/A">0/A</el-radio-button>
                <el-radio-button label="1/A">1/A</el-radio-button>
                <el-radio-button label="2/A">2/A</el-radio-button>
                <el-radio-button label="3/A">3/A</el-radio-button>
                <el-radio-button label="0/B">0/B</el-radio-button>
                <el-radio-button label="1/B">1/B</el-radio-button>
                <el-radio-button label="2/B">2/B</el-radio-button>
                <el-radio-button label="3/B">3/B</el-radio-button>
                <el-radio-button label="0/C">0/C</el-radio-button>
                <el-radio-button label="1/C">1/C</el-radio-button>
                <el-radio-button label="2/C">2/C</el-radio-button>
                <el-radio-button label="3/C">3/C</el-radio-button>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="工序描述" prop="process_des">
              <el-input type="textarea" v-model="product_process.process_des" ttparea=350></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="工序管理员" prop="process_manager">
              <el-select style='width:100%' v-model="product_process.person_name">
                <el-option label="－－无－－" value='' />
                <el-option v-for="dict in person_list" :key="dict.__code" :label="dict.__desc" :value="dict.__code"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="开始时间" prop="begin_time">
              <el-input v-model="product_process.begin_time" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="结束时间" prop="end_time">
              <el-input v-model="product_process.end_time" />
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <div class="form-unit">
        <span class="mvc-title-left"> 基本状态 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="12">
            <el-form-item label="工序性质" prop="">
              <el-select style='width:100%' v-model="empty">
                <el-option label="－－无－－" value='' />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="适用车型" prop="">
              <el-checkbox-group v-model="empty" size="medium">
                <el-checkbox key="引用产品目录的产品">引用产品目录的产品</el-checkbox>
              </el-checkbox-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="适用半成品" prop="">
              <el-checkbox-group v-model="empty" size="medium">
                <el-checkbox key="引用半成品目录中的半成品">引用半成品目录中的半成品</el-checkbox>
              </el-checkbox-group>
            </el-form-item>
          </el-col>
        </el-row>
      </div>
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'ProductProAdd',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        product_process: {
          process_name: null,
          process_no: null,
          process_alter: null,
          process_des: null,
          person_name: null,
          begin_time: null,
          end_time: null,
        },
        person_list: [],
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/mes/product/ProcedureAction/productProAdd?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      productProAddSubmit(_params) {
        request({
          method: 'post',
          url: '/xcapi/VUEAction/mes/product/ProcedureAction/productProAddSubmit?' + _params + this.vueparams,
          data: this.postData()
        }).then(data => {
          this.$router.replace("/redirect" + this.$route.fullPath);
          this.msgSuccess(data.msg);
        })
      },
    },
  }
</script>
